/*
 * 根据配置文件生成 业务处理接口类
 *
 * VERSION  DATE        BY              REASON
 * -------- ----------- --------------- ------------------------------------------
 * 1.00     2014.07.24  wuxiaogang      程序・发布
 * -------- ----------- --------------- ------------------------------------------
 * Copyright 2014 easycode System. - All Rights Reserved.
 *
 */
package cn.com.softvan.easycode.utils;

import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import cn.com.softvan.common.StrUtils;
import cn.com.softvan.common.Validator;
import cn.com.softvan.easycode.bean.ColumsBean;
import cn.com.softvan.easycode.bean.ConfigBean;
import cn.com.softvan.easycode.bean.TableBean;
/**
 * 根据配置文件生成 业务处理接口类
 * @author wuxiaogang 
 *
 */
public class ServiceImplUtils {
	/**
	 * 生成 业务处理类
	 * @param config
	 * @return
	 */
	public static StringBuffer toFile(ConfigBean config){
		StringBuffer csb=new StringBuffer("");
		try {
			if(null==config){
				return csb;
			}
			//TODO 获取表列表
			List<TableBean> tables=config.getTables();
			if(null==tables){
				return csb;
			}
			for(TableBean table:tables){
				try {
					//类名
					String className="";
					//bean 类名
					String beanClassName="";
					//entity 类名
					String entityClassName="";
					//dao 类名
					String daoClassName="";
					//是否生成service impl 0否 1是
					String isService=config.getIsService();
					if(Validator.notEmpty(table.getIsService())){
						isService=table.getIsService();
					}
					String xmlExtends=config.getSpringServiceXmlExtends();
					if(Validator.notEmpty(table.getSpringServiceXmlExtends())){
						xmlExtends=table.getSpringServiceXmlExtends();
					}
					if("0".equals(isService)){
						continue;
					}
					
					//存放内容
					StringBuffer sb=new StringBuffer("");
					//TODO ---1-----版本注释 --2---依赖包引入---类功能注释----
					sb.append(HeaderUtils.getHeader(config, " 业务处理实现类", table,6));
					//TODO ---3----创建类
					sb.append("\n");
					sb.append("public class ");
					if(Validator.isEmpty(table.getClassName())){
						className=StrUtils.toUpperCase(StrUtils.getRidprefixTableName(config.getRidprefixlen(),table.getTableName()),"_")+"Manager";
						daoClassName=StrUtils.toUpperCase(StrUtils.getRidprefixTableName(config.getRidprefixlen(),table.getTableName()),"_")+"Dao";
						beanClassName=StrUtils.toUpperCase(StrUtils.getRidprefixTableName(config.getRidprefixlen(),table.getTableName()),"_")+"Bean";
						entityClassName=StrUtils.toUpperCase(StrUtils.getRidprefixTableName(config.getRidprefixlen(),table.getTableName()),"_");
					}else{
						className=table.getClassName()+"Manager";
						daoClassName=table.getClassName()+"Dao";
						beanClassName=table.getClassName()+"Bean";
						entityClassName=table.getClassName();
					}
					if(Validator.notEmpty(table.getServiceName())){
						className=table.getServiceName();
					}
					sb.append(className);

					
					//-//TODO--3.1--继承----3.2--接口实现----
					sb.append(HeaderUtils.setExtendsAndimplements(config, table, 6));
					
					//--
					sb.append("{\n");
					//--日志记录--
					sb.append("\n\tprivate static final transient Logger log = Logger.getLogger("+className+".class);");
					//--
					sb.append("\n\t/**"+table.getTableNote()+" Dao接口类*/");
					sb.append("\n\tprivate I"+daoClassName+" "+StrUtils.toLowerCaseFirstOne(daoClassName)+";");
					//TODO 获取表字段列表
					List<ColumsBean> columsBeans=table.getColums();
					if(columsBeans==null){
						columsBeans=new ArrayList<ColumsBean>();
					}
					//--主键字段列表--
					List<ColumsBean> pkColumsBeans=new ArrayList<ColumsBean>();
					//---------------------begin------------------------------
					//TODO--saveOrUpdateData
					sb.append("\n\t /**	");
					sb.append("\n\t * <p>信息编辑。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>新增信息。</div>	");
					sb.append("\n\t * <div>修改信息。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t * @throws Exception 	");
					sb.append("\n\t */	");
					sb.append("\n\t@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = CommonConstant.DB_DEFAULT_TIMEOUT, rollbackFor = {	");
					sb.append("\n\t\t\tException.class, RuntimeException.class })	");
					sb.append("\n\tpublic String saveOrUpdateData("+beanClassName+" bean) throws Exception{	");
					sb.append("\n\t\tString msg=\"1\";	");
					sb.append("\n\t\tif(bean!=null){	");
					sb.append("\n\t\t\ttry {	");
					sb.append("\n\t\t\t\t"+entityClassName+" dto=new "+entityClassName+"();	");
					//-----1-字段列表------
					for(ColumsBean colums:columsBeans){
						//是否主键
						if("PRI".equals(StrUtils.toUpperCase(colums.getColumsKey()))){
							pkColumsBeans.add(colums);
						}
						String str=getStr(config.getIsformat(), colums.getColumsName());
						if("detail_info".equals(StrUtils.toLowerCase(colums.getColumsName()))){
							sb.append("\n\t\t\t\tif(Validator.notEmpty(bean.get"+str+"())){");
							sb.append("\n\t\t\t\t	IOHelper.deleteFile(bean.get"+str+"());//TODO=删除文件");
							sb.append("\n\t\t\t\t	dto.set"+str+"(IOHelper.writeHtml(\"html\",bean.get"+str+"()));//内容");
							sb.append("\n\t\t\t\t}");
						}else{
							sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
						}
					}
					sb.append("\n\t\t\t\t	");
					sb.append("\n\t\t\t\t//判断数据是否存在	");
					sb.append("\n\t\t\t\tif("+StrUtils.toLowerCaseFirstOne(daoClassName)+".isDataYN(dto)!=0){	");
					sb.append("\n\t\t\t\t\t//数据存在	");
					sb.append("\n\t\t\t\t\t"+StrUtils.toLowerCaseFirstOne(daoClassName)+".updateByPrimaryKeySelective(dto);	");
					sb.append("\n\t\t\t\t\talog.info(\"修改\", \"用户[\"+getUid()+\"]修改,"+table.getTableNote()+"信息,id[\"+dto.getId()+\"],名称[\"+dto.getName()+\"]\", dto.getCreateId(), dto.getCreateIp());	");
					sb.append("\n\t\t\t\t}else{	");
					sb.append("\n\t\t\t\t\t//新增	");
					
					if(pkColumsBeans!=null && pkColumsBeans.size()>0){
						for(ColumsBean columsBean:pkColumsBeans){
							sb.append("\n\t\t\t\t\tif(Validator.isEmpty(dto.get"+StrUtils.toUpperCaseFirstOne((HeaderUtils.getStr(config.getIsformat(),columsBean.getColumsName())))+"())){	");
							sb.append("\n\t\t\t\t\t\tdto.set"+StrUtils.toUpperCaseFirstOne((HeaderUtils.getStr(config.getIsformat(),columsBean.getColumsName())))+"(IdUtils.createUUID(32));	");
							sb.append("\n\t\t\t\t\t}	");
						}
					}else{
						sb.append("\n\t\t\t\t\tif(Validator.isEmpty(dto.getId())){	");
						sb.append("\n\t\t\t\t\t\tdto.setId(IdUtils.createUUID(32));	");
						sb.append("\n\t\t\t\t\t}	");
					}
				
				
					sb.append("\n\t\t\t\t\t"+StrUtils.toLowerCaseFirstOne(daoClassName)+".insert(dto);	");
					sb.append("\n\t\t\t\t\talog.info(\"新增\", \"用户[\"+getUid()+\"]新增,"+table.getTableNote()+"信息,id[\"+dto.getId()+\"],名称[\"+dto.getName()+\"]\", dto.getCreateId(), dto.getCreateIp());	");
					sb.append("\n\t\t\t\t}	");
					sb.append("\n\t\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\t\tmsg=\"信息保存失败,数据库处理错误!\";	");
					sb.append("\n\t\t\t\tlog.error(msg, e);	");
					sb.append("\n\t\t\t\tthrow new Exception(msg);	");
					sb.append("\n\t\t\t}	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn msg;	");
					sb.append("\n\t}	");
					//TODO---deleteData
					sb.append("\n\t/**	");
					sb.append("\n\t * <p>信息编辑。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>物理删除。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic String deleteData("+beanClassName+" bean) throws Exception{	");
					sb.append("\n\t\tString msg=\"1\";	");
					sb.append("\n\t\tif(bean!=null){	");
					sb.append("\n\t\t\ttry {	");
					sb.append("\n\t\t\t\t"+entityClassName+" dto=new "+entityClassName+"();	");
					
					for(int i=0;i<pkColumsBeans.size();i++){
						ColumsBean colums=pkColumsBeans.get(i);
						String str=getStr(config.getIsformat(),colums.getColumsName());
						sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
					}
					
					sb.append("\n\t\t\t\t"+StrUtils.toLowerCaseFirstOne(daoClassName)+".deleteByPrimaryKey(dto);	");
					sb.append("\n\t\t\t\talog.info(\"删除\", \"用户[\"+getUid()+\"]物理删除,"+table.getTableNote()+"信息,id[\"+dto.getId()+\"],名称[\"+dto.getName()+\"]\", dto.getCreateId(), dto.getCreateIp());	");
					sb.append("\n\t\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\t\tmsg=\"信息删除失败,数据库处理错误!\";	");
					sb.append("\n\t\t\t\tlog.error(msg, e);	");
					sb.append("\n\t\t\t}	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn msg;	");
					sb.append("\n\t}	");
					//TODO---deleteDataById
					sb.append("\n\t/**	");
					sb.append("\n\t * <p>信息 单条。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>逻辑删除。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t */	");
					sb.append("\n\t@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = CommonConstant.DB_DEFAULT_TIMEOUT, rollbackFor = {	");
					sb.append("\n\t\t\tException.class, RuntimeException.class })	");
					sb.append("\n\tpublic String deleteDataById("+beanClassName+" bean) throws Exception{	");
					sb.append("\n\t\tString msg=\"1\";	");
					sb.append("\n\t\tif(bean!=null){	");
					sb.append("\n\t\t\ttry {	");
					sb.append("\n\t\t\t\t"+entityClassName+" dto=new "+entityClassName+"();	");
					for(int i=0;i<pkColumsBeans.size();i++){
						ColumsBean colums=pkColumsBeans.get(i);
						String str=getStr(config.getIsformat(),colums.getColumsName());
						sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
					}
					sb.append("\n\t\t\t\t"+StrUtils.toLowerCaseFirstOne(daoClassName)+".deleteById(dto);	");
					sb.append("\n\t\t\t\talog.info(\"删除\", \"用户[\"+getUid()+\"]删除,"+table.getTableNote()+"信息,id[\"+dto.getId()+\"],名称[\"+dto.getName()+\"]\", dto.getCreateId(), dto.getCreateIp());	");
					sb.append("\n\t\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\t\tmsg=\"信息删除失败,数据库处理错误!\";	");
					sb.append("\n\t\t\t\tlog.error(msg, e);	");
					sb.append("\n\t\t\t\tthrow new Exception(msg);	");
					sb.append("\n\t\t\t}	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn msg;	");
					sb.append("\n\t}	");
					
					//TODO---findDataIsPage
					sb.append("\n\t/**	");
					sb.append("\n\t * <p>信息列表 分页。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>信息检索。</div>	");
					sb.append("\n\t * <div>分页。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic List<"+beanClassName+"> findDataIsPage("+beanClassName+" bean){	");
					sb.append("\n\t\tList<"+beanClassName+"> beans=null;	");
					sb.append("\n\t\ttry {	");
					sb.append("\n\t\t   "+entityClassName+" dto=new "+entityClassName+"();	");
					sb.append("\n\t\t   if(bean!=null){	");
					//-----1-字段列表------
					for(ColumsBean colums:columsBeans){
						String str=getStr(config.getIsformat(),colums.getColumsName());
						sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
					}
					sb.append("\n\t\t\t\tdto.setPageInfo(bean.getPageInfo());//分页对象     ");
					sb.append("\n\t\t\t\tdto.setDate1(bean.getDate1());//起始时间     ");
					sb.append("\n\t\t\t\tdto.setDate2(bean.getDate2());//结束时间     ");
					sb.append("\n\t\t   }	");
					sb.append("\n\t\t\tbeans=(List<"+beanClassName+">) "+StrUtils.toLowerCaseFirstOne(daoClassName)+".findDataIsPage(dto);	");
					sb.append("\n\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\tlog.error(\"信息查询失败,数据库错误!\", e);	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn beans;	");
					sb.append("\n\t}	");
					
					//TODO---findDataIsList
					sb.append("\n\t/**	");
					sb.append("\n\t * <p>信息列表。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>信息检索。</div>	");
					sb.append("\n\t * <div>列表。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic List<"+beanClassName+"> findDataIsList("+beanClassName+" bean){	");
					sb.append("\n\t\tList<"+beanClassName+"> beans=null;	");
					sb.append("\n\t\ttry {	");
					sb.append("\n\t\t\t   "+entityClassName+" dto=new "+entityClassName+"();	");
					sb.append("\n\t\t\t   if(bean!=null){	");
					//-----1-字段列表------
					for(ColumsBean colums:columsBeans){
						String str=getStr(config.getIsformat(),colums.getColumsName());
						sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
					}
					sb.append("\n\t\t\t\tdto.setDate1(bean.getDate1());//起始时间     ");
					sb.append("\n\t\t\t\tdto.setDate2(bean.getDate2());//结束时间     ");
					sb.append("\n\t\t\t\tdto.setLimit1(bean.getLimit1());//人工分页 offset     ");
					sb.append("\n\t\t\t\tdto.setLimit2(bean.getLimit2());////人工分页 当前页显示数量     ");
					sb.append("\n\t\t\t   }	");
					sb.append("\n\t\t\t\tbeans=(List<"+beanClassName+">) "+StrUtils.toLowerCaseFirstOne(daoClassName)+".findDataIsList(dto);	");
					sb.append("\n\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\tlog.error(\"信息查询失败,数据库错误!\", e);	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn beans;	");
					sb.append("\n\t}	");
					
					//TODO---findDataById
					sb.append("\n\t/**	");
					sb.append("\n\t * <p>信息详情。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>信息检索。</div>	");
					sb.append("\n\t * <div>详情。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic "+beanClassName+" findDataById("+beanClassName+" bean){	");
					sb.append("\n\t   "+beanClassName+" bean1=null;	");
					sb.append("\n\t   try {	");
					sb.append("\n\t\t   "+entityClassName+" dto=new "+entityClassName+"();	");
					sb.append("\n\t\t   if(bean!=null){	");
					String detail_info_flag=null;
					//-----1-字段列表------
					for(ColumsBean colums:columsBeans){
						String str=getStr(config.getIsformat(),colums.getColumsName());
						sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
						if("detail_info".equals(StrUtils.toLowerCase(colums.getColumsName()))){
							detail_info_flag="cunz";
						}
					}
					sb.append("\n\t\t   }	");
					sb.append("\n\t\t\tbean1=("+beanClassName+") "+StrUtils.toLowerCaseFirstOne(daoClassName)+".selectByPrimaryKey(dto);	");
					if(detail_info_flag!=null){
						sb.append("\n\t\t\tif(bean1!=null  && Validator.notEmpty(bean1.get"+getStr(config.getIsformat(),"detail_info")+"())){	");
						sb.append("\n\t\t\t\tbean1.set"+getStr(config.getIsformat(),"detail_info")+"(IOHelper.readHtml(bean1.get"+getStr(config.getIsformat(),"detail_info")+"()));	");
						sb.append("\n\t\t\t}");
					}else{
						sb.append("\n\t\t\t//if(bean1!=null  && Validator.notEmpty(bean1.get"+getStr(config.getIsformat(),"detail_info")+"())){	");
						sb.append("\n\t\t\t\t//bean1.set"+getStr(config.getIsformat(),"detail_info")+"(IOHelper.readHtml(bean1.get"+getStr(config.getIsformat(),"detail_info")+"()));	");
						sb.append("\n\t\t\t//}	");
					}
					sb.append("\n\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\tlog.error(\"信息详情查询失败,数据库错误!\", e);	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn bean1;	");
					sb.append("\n\t}	");
					//TODO---recoveryDataById
					sb.append("\n\t/**	");
					sb.append("\n\t * <p>信息 单条。</p>	");
					sb.append("\n\t * <ol>[功能概要] 	");
					sb.append("\n\t * <div>恢复逻辑删除的数据。</div>	");
					sb.append("\n\t * </ol>	");
					sb.append("\n\t * @return 处理结果	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic String recoveryDataById("+beanClassName+" bean) throws Exception{	");
					sb.append("\n\t\tString msg=\"1\";	");
					sb.append("\n\t\tif(bean!=null){	");
					sb.append("\n\t\t\ttry {	");
					sb.append("\n\t\t\t\t"+entityClassName+" dto=new "+entityClassName+"();	");
					for(int i=0;i<pkColumsBeans.size();i++){
						ColumsBean colums=pkColumsBeans.get(i);
						String str=getStr(config.getIsformat(),colums.getColumsName());
						sb.append("\n\t\t\t\tdto.set"+str+"(bean.get"+str+"());//"+StrUtils.replaceAll(colums.getColumsNote(), "\\s*", "")+"	");
					}
					sb.append("\n\t\t\t\t"+StrUtils.toLowerCaseFirstOne(daoClassName)+".recoveryDataById(dto);	");
					sb.append("\n\t\t\t\talog.info(\"恢复\", \"用户[\"+getUid()+\"]恢复,"+table.getTableNote()+"信息,id[\"+dto.getId()+\"],名称[\"+dto.getName()+\"]\", dto.getCreateId(), dto.getCreateIp());	");
					sb.append("\n\t\t\t} catch (Exception e) {	");
					sb.append("\n\t\t\t\tmsg=\"信息恢复失败,数据库处理错误!\";	");
					sb.append("\n\t\t\t\tlog.error(msg, e);	");
					sb.append("\n\t\t\t\tthrow new Exception(msg);	");
					sb.append("\n\t\t\t}	");
					sb.append("\n\t\t}	");
					sb.append("\n\t\treturn msg;	");
					sb.append("\n\t}	");
					//TODO---set dao
					sb.append("\n\t/**	");
					sb.append("\n\t * 信息DAO 接口类取得	");
					sb.append("\n\t * @return 信息DAO 接口类	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic I"+daoClassName+" get"+StrUtils.toUpperCaseFirstOne(daoClassName)+"() {	");
					sb.append("\n\t\treturn "+StrUtils.toLowerCaseFirstOne(daoClassName)+";	");
					sb.append("\n\t}	");
					sb.append("\n\t/**	");
					sb.append("\n\t * 信息DAO 接口类设定	");
					sb.append("\n\t * @param "+StrUtils.toLowerCaseFirstOne(daoClassName)+" 信息DAO 接口类	");
					sb.append("\n\t */	");
					sb.append("\n\tpublic void set"+StrUtils.toUpperCaseFirstOne(daoClassName)+"(I"+daoClassName+" "+StrUtils.toLowerCaseFirstOne(daoClassName)+") {	");
					sb.append("\n\t\tthis."+StrUtils.toLowerCaseFirstOne(daoClassName)+" = "+StrUtils.toLowerCaseFirstOne(daoClassName)+";	");
					sb.append("\n\t}	");

					
					//----------------- ----end------------------------------
					sb.append("\n}");
					//文件保存路径 项目根目录+包路径+类名称
					String fileurl=config.getJavaDirUrl()+config.getServicePackage().replace(".", "/")+"/impl";
					//创建文件夹
			    	File saveDirFile = new File(fileurl);
			    	if (!saveDirFile.exists()) {
			    		saveDirFile.mkdirs();
			    	}
					//写入文件
					PrintWriter pw=new PrintWriter(fileurl+"/"+className+".java","utf8");
					pw.write(sb.toString());
					pw.close();
					

					csb.append("\n\t<!-- "+table.getTableNote()+" 业务处理 -->	");
					csb.append("\n\t<bean id=\""+StrUtils.toLowerCaseFirstOne(className)+"\" class=\""+config.getServicePackage()+".impl."+className+"\"");
					if(Validator.notEmpty(xmlExtends)){
						csb.append(" parent=\""+xmlExtends+"\"");
					}
					csb.append(" scope=\"prototype\">	");
					csb.append("\n\t\t<property name=\""+StrUtils.toLowerCaseFirstOne(daoClassName)+"\" ref=\""+StrUtils.toLowerCaseFirstOne(daoClassName)+"\"></property>	");
					csb.append("\n\t</bean>	");

				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return csb;
	}
	private static String getStr(String isFormat,String colums){
		if("1".equals(isFormat)){
			return StrUtils.toUpperCaseFirstOne(StrUtils.toUpperCase(colums,"_"));
		}else{
			return StrUtils.toUpperCaseFirstOne(colums);
		}
		
	}
}
